<?php
/**
 * Created by ook.fun.
 * User: alex
 * Date: 18-8-24
 * Time: 下午10:04
 */

namespace app\api\controller\v1;



use app\api\lib\enum\DemoEnum;
use app\api\validate\DemoValidate;

class demo extends BaseController
{
    /*
     * Demo方法
     * @url      'api/v1/demo/:id
     * @method    get
     * @param     int $id
     * @throw     DemoException
     * @return    String @result hello world
     */
    public function getById($id = '')
    {
        (new DemoValidate()) ->goCheck();

        $result= 'hello ' . $id . ' ' . config('setting.version') . ' ' . DemoEnum::DEMO_OK;
        return $result;
    }
}